﻿using System.ComponentModel;

namespace ManagementApi.Models
{
    /// <summary>
    /// 验证码信息
    /// </summary>
    public class VerifyCode
    {
        /// <summary>
        /// 验证码
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 验证码数据流
        /// </summary>
        public byte[] Image { get; set; }
        /// <summary>
        /// base64
        /// </summary>
        public string Base64Str { get { return Convert.ToBase64String(Image); } }
    }
    /// <summary>
    /// 验证码类型
    /// </summary>
    public enum VerifyCodeType
    {
        [Description("纯数字验证码")]
        NUM = 0,
        [Description("数字加字母验证码")]
        CHAR = 1,
        [Description("数字运算验证码")]
        ARITH = 2,
    }

    public class VerifyCodeCache
    {
        /// <summary>
        /// 验证码
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 唯一码
        /// </summary>
        public string Id { get; set; }
    }

    public class VerifyCodeResult
    {
        /// <summary>
        /// 唯一码
        /// </summary>
        public string Id { get; set; }

        public string Base64Str { get; set; }
    }
}
